using net_work.Data.DTO.Sys;
using net_work.Data.Entity.Sys;

namespace net_work.IRepository.Sys;

public interface IUserRepository : IRepository<User>
{
    /// <summary>
    /// 根据账号获取用户
    /// </summary>
    /// <param name="userAccount">账号（可能为账号，手机号，邮箱）</param>
    /// <returns>用户</returns>
    Task<User?> GetByAccountAsync(string userAccount); // 根据账号获取用户

    /// <summary>
    /// 插入用户
    /// </summary>
    /// <param name="userAddRequest">插入用户</param>
    /// <returns>新增用户Id</returns>
    Task<long> InsertAsync(UserAddRequest userAddRequest);

    /// <summary>
    /// 更新用户信息
    /// </summary>
    /// <param name="userUpdateRequest">更新用户信息</param>
    /// <returns>是否成功</returns>
    Task<bool> UpdateAsync(UserUpdateRequest userUpdateRequest);
}